package com.atguigu.stgy.common.exception;

import com.atguigu.stgy.model.result.ResultCodeEnum;
import lombok.Getter;

@Getter
public class StgyException extends RuntimeException{
    private ResultCodeEnum codeEnum;
    private Throwable e;
    public StgyException(ResultCodeEnum codeEnum,Exception e){
        super(codeEnum.getMessage());
        this.codeEnum = codeEnum;
        //接受发生异常时的原生异常对象(包含了堆栈日志)
        this.e = e;
    }
    public StgyException(ResultCodeEnum codeEnum){
        super(codeEnum.getMessage());
        this.codeEnum = codeEnum;
    }
}
